<template>
<!-- 退费 -->
  <section class="printOrder">
    <div class="print_box">
      <h3 style="text-align:center;">{{hospital}}</h3>
      <h3 style="text-align:center;">还款清单</h3>
      <ul class="nav_patient_menu">
          <li>姓  名：{{detail.name}}</li>
          <li>性  别：{{detail.sex | toSex}}</li>
          <li>病历号：{{detail.archivesCode}}</li>
          <li>出生日期：{{detail.birthday}}</li>
          <li>证 件 号：{{detail.idCard}}</li>
          <li>退费日期：{{time}}</li>
      </ul>
      <table class="table-box">
        <thead>
          <tr>
            <th>还款日期</th>
            <th>还款金额</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(item,index) in item" :key="index">
            <td>{{item.cureDetailDTO.sourceName}}</td>
            <td>{{item.cureDetailDTO.num}}</td>
          </tr>
        </tbody>
      </table>
      <div class="footer_box print_footer_box">
        <p>挂账金额：￥2015.00元</p>
        <p>还款合计： -1000.00元</p>
        <p style="text-align:right;">退费金额：￥{{total | changeMoneyToTwo}}</p>
      </div>
      <div class="footer_box print_footer_box onfooter_box ">
        <p></p>
        <p></p>
        <p>收 款 人：{{name}}</p>
      </div>
    </div>
  </section>
</template>
<script>
export default {
  props: ["orderId", "detail","item","total","name"],
  data() {
    return {
      hospital:'',
      itemList: [],
      dwList: [],
      time:''
    };
  },
  created(){
      this.time=this.getNewDate();
  },
  mounted() {
    let th=this;
    th.hospital=th.adminUser.hospitalName;
    th.onPrint();
  },
  methods: {
    onPrint(){
        window.document.body.innerHTML = document.getElementsByClassName("printOrder")[0].innerHTML;
        window.print();
        window.location.reload();
    },
    getBasic() {
      let th = this;
      th.getCommonConfigByKey("药品剂量单位").then(res => {
        th.dwList = res;
      });
    }
  }
};
</script>